/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  const auth = app.middleware.auth();
  // router.get('/', controller.home.index);
  router.prefix('/api/v1');
  // 用户频道
  router.post('/users', controller.user.create);
  // 用户登录
  router.post('/users/login', controller.user.login);
  // 获取详情
  router.get('/users/info/:userId', app.middleware.auth({ required: false }), controller.user.userInfo);
  router.get('/users/subscribe/:subscribeId', auth, controller.user.subscribe);
  // 视频管理
  router.get('/video/getVod', auth, controller.vod.getVod);
  router.get('/video/getVod/:videoId', controller.vod.getVideo);
  router.post('/video/comment/:videoId', auth, controller.video.createComment);
  router.get('/video/getHots', controller.video.getHots);
};
